package com.spzx.user.controller;


import com.spzx.common.core.web.domain.AjaxResult;
import com.spzx.user.service.IUserBrowseHistoryService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.Parameter;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;
import com.spzx.common.core.web.controller.BaseController;

/**
 * <p>
 * 用户浏览记录表 前端控制器
 * </p>
 *
 * @author atguigu
 * @since 2024-11-18
 */
@RestController
@RequestMapping("/userBrowseHistory")
public class UserBrowseHistoryController extends BaseController {

    @Autowired
    private IUserBrowseHistoryService userBrowseHistoryService;

    @Operation(summary = "保存用户浏览记录")
    @Parameter(description = "商品skuId")
    @GetMapping("/saveUserBrowseHistory/{skuId}")
    public AjaxResult saveUserBrowseHistory(@PathVariable Long skuId) {
        userBrowseHistoryService.saveUserBrowseHistory(skuId);
        return success();
    }
}
